<beans>

	<bean id="core" class="it.millemultimedia.easyBlog.core.EasyBlog">
		<property name="UserService">
			<ref bean="service.User" />
		</property>
		<property name="RoleService">
			<ref bean="service.Role" />
		</property>
		<property name="PermissionService">
			<ref bean="service.Permission" />
		</property>
		<property name="PreferenceService">
			<ref bean="service.Preference" />
		</property>
		<property name="SecurityService">
			<ref bean="service.Security" />
		</property>
		<property name="CategoryService">
			<ref bean="service.Category" />
		</property>
		<property name="CommentService">
			<ref bean="service.Comment" />
		</property>
		<property name="PostService">
			<ref bean="service.Post" />
		</property>
		<property name="BlogService">
			<ref bean="service.Blog"/>
		</property>
		<property name="SettingService">
			<ref bean="service.Setting"/>
		</property>
		<property name="SkinService">
			<ref bean="service.Skin"/>
		</property>
	</bean>
	
	<!-- Datasource configuration -->
	
	<bean id="datasource" class="it.millemultimedia.easyBlog.model.DataSource">
		<constructor-arg name="name">
			<value>${dsnname}</value>			
		</constructor-arg>
		<constructor-arg name="userName">
			<value>${dsnusername}</value>			
		</constructor-arg>
		<constructor-arg name="password">
			<value>${dsnpassword}</value>			
		</constructor-arg>
	</bean>
	
	<bean abstract="true" id="absDAO">
		
		<constructor-arg type="it.millemultimedia.easyBlog.model.DataSource" name="dataSource">
    		<ref bean="dataSource" />
		</constructor-arg>
		
    </bean>
	
	<!-- utils -->
	
	<bean id="util.sessionMgr" class="it.millemultimedia.util.SessionMgr">
		<constructor-arg name="scope">
			<value>session</value>			
		</constructor-arg>			
	</bean>
	
	<bean id="util.security" class="it.millemultimedia.util.Security">
		
		<property name="key">
			<value>www.millemultimedia.it</value>
		</property>
		
		<property name="keyAlgorithm">
			<value>SHA-512</value>
		</property>
		
		<property name="cryptAlgorithm">
			<value>CFMX_COMPAT</value>
		</property>
		
		<property name="cryptEncoding">
			<value>Base64</value>
		</property>
		
    </bean>

	<!-- Plugin manager -->
	 
	<bean id="plugin.manager" class="it.millemultimedia.easyBlog.core.PluginManager">
		<constructor-arg name="modelGlueLoader">
			<bean class="ModelGlue.gesture.module.XMLModuleLoader" />			
		</constructor-arg>
		<constructor-arg name="coldSpringLoader">
			<bean class="it.millemultimedia.easyBlog.util.XMLColdSpringLoader" />			
		</constructor-arg>
		<constructor-arg name="pluginRoot">
			<value>./plugins/</value>	
		</constructor-arg>
		<constructor-arg name="pluginDB">
			<value>./config/Plugins.json.cfm</value>				
		</constructor-arg>
	</bean>



	<!-- security -->
	
	<bean id="service.Security" class="it.millemultimedia.easyBlog.service.SecurityService">
	
		<property name="SessionMgr">
			<ref bean="util.SessionMgr" />
		</property>
		
		<property name="LoginFactory">
			<ref bean="factory.Login" />
		</property>
		
		<property name="Security">
			<ref bean="util.security" />
		</property>
		
		<property name="UserDelegate">
			<ref bean="delegate.User" />
		</property>
		
	</bean>
	
	<bean id="factory.Login" class="it.millemultimedia.easyBlog.factory.LoginFactory" />

	<!-- settings -->
	
	<!-- blog -->
	
	<bean id="service.Blog" class="it.millemultimedia.easyBlog.service.BlogService">
	
		<property name="BlogDelegate">
			<ref bean="delegate.Blog" />
		</property>
		
	</bean>
	
	<bean id="factory.Blog" class="it.millemultimedia.easyBlog.factory.BlogFactory" />
	
	<bean id="delegate.Blog" class="it.millemultimedia.easyBlog.delegate.BlogDelegate">
	
		<constructor-arg name="dataObject">
			<ref bean="dao.Blog" />
		</constructor-arg>
		
		<property name="BlogFactory">
			<ref bean="factory.Blog" />
		</property>
		
	</bean>
	
	<bean id="dao.Blog" class="it.millemultimedia.easyBlog.dao.BlogDAO" parent="absDAO" />
	
	<!-- setting -->
	
	<bean id="service.Setting" class="it.millemultimedia.easyBlog.service.SettingService">
	
		<property name="SettingDelegate">
			<ref bean="delegate.Setting" />
		</property>
		
	</bean>
	
	<bean id="factory.Setting" class="it.millemultimedia.easyBlog.factory.SettingFactory" />
	
	<bean id="delegate.Setting" class="it.millemultimedia.easyBlog.delegate.SettingDelegate">
	
		<constructor-arg name="dataObject">
			<ref bean="dao.Setting" />
		</constructor-arg>
		
		<property name="SettingFactory">
			<ref bean="factory.Setting" />
		</property>
		
	</bean>
	
	<bean id="dao.Setting" class="it.millemultimedia.easyBlog.dao.SettingDAO" parent="absDAO" />

	<!-- Skin -->

	<bean id="service.Skin" class="it.millemultimedia.easyBlog.service.SkinService">
	
		<property name="SkinDelegate">
			<ref bean="delegate.Skin" />
		</property>
		
	</bean>
	
	<bean id="factory.Skin" class="it.millemultimedia.easyBlog.factory.SkinFactory"/>
	
	<bean id="delegate.Skin" class="it.millemultimedia.easyBlog.delegate.SkinDelegate">
	
		<constructor-arg name="dataObject">
			<ref bean="dao.Skin" />
		</constructor-arg>
		
		<property name="SkinFactory">
			<ref bean="factory.Skin" />
		</property>
		
	</bean>
	
	<bean id="dao.Skin" class="it.millemultimedia.easyBlog.dao.SkinDAO" parent="absDAO" />

	<!-- category -->

	<bean id="service.Category" class="it.millemultimedia.easyBlog.service.CategoryService">
	
		<property name="CategoryDelegate">
			<ref bean="delegate.Category" />
		</property>
		
	</bean>
	
	<bean id="factory.Category" class="it.millemultimedia.easyBlog.factory.CategoryFactory"/>
	
	<bean id="delegate.Category" class="it.millemultimedia.easyBlog.delegate.CategoryDelegate">
	
		<constructor-arg name="dataObject">
			<ref bean="dao.Category" />
		</constructor-arg>
		
		<property name="CategoryFactory">
			<ref bean="factory.Category" />
		</property>
		
	</bean>
	
	<bean id="dao.Category" class="it.millemultimedia.easyBlog.dao.CategoryDAO" parent="absDAO" />
	
	<!-- comments -->
	
	<bean id="service.Comment" class="it.millemultimedia.easyBlog.service.CommentService">
	
		<property name="CommentDelegate">
			<ref bean="delegate.Comment" />
		</property>
		
	</bean>
	
	<bean id="factory.Comment" class="it.millemultimedia.easyBlog.factory.CommentFactory"/>
	
	<bean id="delegate.Comment" class="it.millemultimedia.easyBlog.delegate.CommentDelegate">
	
		<constructor-arg name="dataObject">
			<ref bean="dao.Comment" />
		</constructor-arg>
		
		<property name="CommentFactory">
			<ref bean="factory.Comment" />
		</property>
		
	</bean>
	
	<bean id="dao.Comment" class="it.millemultimedia.easyBlog.dao.CommentDAO" parent="absDAO" />
	
	<!-- permission -->

	<bean id="service.Permission" class="it.millemultimedia.easyBlog.service.PermissionService">
	
		<property name="PermissionDelegate">
			<ref bean="delegate.Permission" />
		</property>
		
	</bean>
	
	<bean id="factory.Permission" class="it.millemultimedia.easyBlog.factory.PermissionFactory"/>
	
	<bean id="delegate.Permission" class="it.millemultimedia.easyBlog.delegate.PermissionDelegate">
	
		<constructor-arg name="dataObject">
			<ref bean="dao.Permission" />
		</constructor-arg>
		
		<property name="PermissionFactory">
			<ref bean="factory.Permission" />
		</property>
		
	</bean>
	
	<bean id="dao.Permission" class="it.millemultimedia.easyBlog.dao.PermissionDAO" parent="absDAO" />

	<bean id="service.Post" class="it.millemultimedia.easyBlog.service.PostService">
	
		<property name="PostDelegate">
			<ref bean="delegate.Post" />
		</property>
		
		<property name="SettingFactory">
			<ref bean="factory.Setting" />
		</property>
		
		<property name="SessionMgr">
			<ref bean="util.SessionMgr" />
		</property>
		
		<property name="FeedManager">
			<bean class="it.millemultimedia.util.FeedManager" />
		</property>
		
		<property name="BlogDelegate">
			<ref bean="delegate.Blog" />
		</property>
		
	</bean>
	
	<bean id="factory.Post" class="it.millemultimedia.easyBlog.factory.PostFactory"></bean>
	
	<bean id="delegate.Post" class="it.millemultimedia.easyBlog.delegate.PostDelegate">
	
		<constructor-arg name="dataObject">
			<ref bean="dao.Post" />
		</constructor-arg>
		
		<property name="PostFactory">
			<ref bean="factory.Post" />
		</property>
		
	</bean>
	
	<bean id="dao.Post" class="it.millemultimedia.easyBlog.dao.PostDAO" parent="absDAO" />
	
	<!-- preference -->
	
	<bean id="service.Preference" class="it.millemultimedia.easyBlog.service.PreferenceService">
	
		<property name="PreferenceDelegate">
			<ref bean="delegate.Preference" />
		</property>
		
	</bean>
	
	<bean id="factory.Preference" class="it.millemultimedia.easyBlog.factory.PreferenceFactory"/>
	
	<bean id="delegate.Preference" class="it.millemultimedia.easyBlog.delegate.PreferenceDelegate">
	
		<constructor-arg name="dataObject">
			<ref bean="dao.Preference" />
		</constructor-arg>
		
		<property name="PreferenceFactory">
			<ref bean="factory.Preference" />
		</property>
		
	</bean>
	
	<bean id="dao.Preference" class="it.millemultimedia.easyBlog.dao.PreferenceDAO" parent="absDAO" />
	
	<!-- role -->
	
	<bean id="service.Role" class="it.millemultimedia.easyBlog.service.RoleService">
	
		<property name="RoleDelegate">
			<ref bean="delegate.Role" />
		</property>
		
	</bean>
	
	<bean id="factory.Role" class="it.millemultimedia.easyBlog.factory.RoleFactory"/>
	
	<bean id="delegate.Role" class="it.millemultimedia.easyBlog.delegate.RoleDelegate">
	
		<constructor-arg name="dataObject">
			<ref bean="dao.Role" />
		</constructor-arg>
		
		<property name="RoleFactory">
			<ref bean="factory.Role" />
		</property>
		
	</bean>
	
	<bean id="dao.Role" class="it.millemultimedia.easyBlog.dao.RoleDAO" parent="absDAO" />
	
	<!-- user -->
	
	<bean id="service.User" class="it.millemultimedia.easyBlog.service.UserService">
	
		<property name="UserDelegate">
			<ref bean="delegate.User" />
		</property>
		
		<property name="Security">
			<ref bean="util.security" />
		</property>
		
	</bean>
	
	<bean id="factory.User" class="it.millemultimedia.easyBlog.factory.UserFactory"/>
	
	<bean id="delegate.User" class="it.millemultimedia.easyBlog.delegate.UserDelegate">
	
		<constructor-arg name="dataObject">
			<ref bean="dao.User" />
		</constructor-arg>
		
		<property name="UserFactory">
			<ref bean="factory.User" />
		</property>
		
	</bean>
	
	<bean id="dao.User" class="it.millemultimedia.easyBlog.dao.UserDAO" parent="absDAO" />

</beans>